onelist = [[1.1, [1.21, 1.22], [1.31, 1.32], 1.4], 2, [3.1, 3.2], [4.1, [4.21, 4.22]]]


def depth_search(l):
    # 深度搜索
    if isinstance(l, list):
        for i in l:
            depth_search(i)
    else:
        print(l)


def bread_search(l):
    # 广度搜索
    m = []
    for i in range(len(l)):
        # 先第一层依次判断是否是列表，不是列表打印，是列表进入下次循环
        if not isinstance(l[i], list):
            print(l[i])
        else:
            m.append(i)
    if m != []:
        m1 = []
        for j in m:
            m1 += l[j]
        bread_search(m1)


if __name__ == '__main__':
    bread_search(onelist)
